﻿#include "Server.Database.ItemInfoFormNew.h"
#include "../Server.SMain.h"
#include "../../Shared/Functions/RegexFunctions.h"
#include "../../Shared/Data/ItemData.h"

using namespace Server::MirEnvir;

namespace Server::Database
{

    Server::MirEnvir::Envir *ItemInfoFormNew::getEnvir() const
    {
        return SMain::getEditEnvir();
    }

    ItemInfoFormNew::ItemInfoFormNew()
    {
        InitializeComponent();

        InitializeItemInfoFilters();
        InitializeItemInfoGridView();

        CreateDynamicColumns();

        PopulateTable();
    }

    void ItemInfoFormNew::InitializeItemInfoFilters()
    {
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        auto types = Enum::GetValues(typeof(ItemType));
        System::Web::UI::WebControls::ListItem tempVar("", "-1");
        drpFilterType->Items->Add(&tempVar);
        for (auto type : *types)
        {
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            System::Web::UI::WebControls::ListItem tempVar2(type.ToString(), std::to_string(static_cast<unsigned char>(type)));
            drpFilterType->Items->Add(&tempVar2);
        }
    }

    void ItemInfoFormNew::InitializeItemInfoGridView()
    {
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        Modified->ValueType = typeof(bool);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemIndex->ValueType = typeof(int);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemName->ValueType = typeof(std::string);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemRandomStatsId->ValueType = typeof(unsigned char);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemRequiredAmount->ValueType = typeof(unsigned char);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemImage->ValueType = typeof(unsigned short);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemShape->ValueType = typeof(short);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemEffect->ValueType = typeof(unsigned char);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemStackSize->ValueType = typeof(unsigned short);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemSlots->ValueType = typeof(unsigned char);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemWeight->ValueType = typeof(unsigned char);

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemLightIntensity->ValueType = typeof(unsigned char);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemLightRange->ValueType = typeof(unsigned char);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemDurability->ValueType = typeof(unsigned short);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        ItemPrice->ValueType = typeof(unsigned int);

        //Basic
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        this->ItemType->ValueType = typeof(ItemType);
        this->ItemType->DataSource = Enum2DataTable<ItemType>();
        this->ItemType->ValueMember = "Value";
        this->ItemType->DisplayMember = "Display";

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        this->ItemGrade->ValueType = typeof(ItemGrade);
        this->ItemGrade->DataSource = Enum2DataTable<ItemGrade>();
        this->ItemGrade->ValueMember = "Value";
        this->ItemGrade->DisplayMember = "Display";

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        this->ItemRequiredType->ValueType = typeof(RequiredType);
        this->ItemRequiredType->DataSource = Enum2DataTable<RequiredType>();
        this->ItemRequiredType->ValueMember = "Value";
        this->ItemRequiredType->DisplayMember = "Display";

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        this->ItemRequiredGender->ValueType = typeof(RequiredGender);
        this->ItemRequiredGender->DataSource = Enum2DataTable<RequiredGender>();
        this->ItemRequiredGender->ValueMember = "Value";
        this->ItemRequiredGender->DisplayMember = "Display";

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        this->ItemRequiredClass->ValueType = typeof(RequiredClass);
        this->ItemRequiredClass->DataSource = Enum2DataTable<RequiredClass>();
        this->ItemRequiredClass->ValueMember = "Value";
        this->ItemRequiredClass->DisplayMember = "Display";

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        this->ItemSet->ValueType = typeof(ItemSet);
        this->ItemSet->DataSource = Enum2DataTable<ItemSet>();
        this->ItemSet->ValueMember = "Value";
        this->ItemSet->DisplayMember = "Display";
    }

    void ItemInfoFormNew::CreateDynamicColumns()
    {
        for (auto stat : *StatEnums)
        {
            if (stat == Stat::Unknown)
            {
                continue;
            }

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            auto key = stat.ToString();
            auto strKey = RegexFunctions::SeperateCamelCase(StringHelper::replace(StringHelper::replace(StringHelper::replace(key, "Rate", ""), "Multiplier", ""), "Percent", ""));

            auto sign = "";

            if (key.find("Percent") != std::string::npos)
            {
                sign = "%";
            }
            else if (key.find("Multiplier") != std::string::npos)
            {
                sign = "x";
            }

            auto col = new DataGridViewTextBoxColumn();
            col->HeaderText = StringHelper::formatSimple("{0} {1}", strKey, sign);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            col->Name = "Stat" + stat.ToString();
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
            col->ValueType = typeof(int);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            col->DataPropertyName = "Stat" + stat.ToString();

            itemInfoGridView->Columns->Add(col);

//C# TO C++ CONVERTER TODO TASK: A 'delete col' statement was not added since col was passed to a method or constructor. Handle memory management manually.
        }

        for (auto bind : *BindEnums)
        {
            if (bind == BindMode::None)
            {
                continue;
            }

            auto col = new DataGridViewCheckBoxColumn();
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            col->HeaderText = bind.ToString();
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            col->Name = "Bind" + bind.ToString();
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
            col->ValueType = typeof(bool);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            col->DataPropertyName = "Bind" + bind.ToString();

            itemInfoGridView->Columns->Add(col);

//C# TO C++ CONVERTER TODO TASK: A 'delete col' statement was not added since col was passed to a method or constructor. Handle memory management manually.
        }

        for (auto special : *SpecialEnums)
        {
            if (special == SpecialItemMode::None)
            {
                continue;
            }

            auto col = new DataGridViewCheckBoxColumn();
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            col->HeaderText = special.ToString();
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            col->Name = "Special" + special.ToString();
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
            col->ValueType = typeof(bool);
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            col->DataPropertyName = "Special" + special.ToString();

            itemInfoGridView->Columns->Add(col);

//C# TO C++ CONVERTER TODO TASK: A 'delete col' statement was not added since col was passed to a method or constructor. Handle memory management manually.
        }

    }

    void ItemInfoFormNew::PopulateTable()
    {
        Table = new DataTable("itemInfo");

        for (DataGridViewColumn *col : *itemInfoGridView->Columns)
        {
            Table->Columns->Add(col->DataPropertyName, col->ValueType);
        }

        for (auto item : getEnvir()->ItemInfoList)
        {
            DataRow *row = Table->NewRow();

            row["Modified"] = false;

            row["ItemIndex"] = item->Index;
            row["ItemName"] = item->Name;

            row["ItemType"] = item->Type;
            row["ItemGrade"] = item->Grade;
            row["ItemRequiredType"] = item->RequiredType;
            row["ItemRequiredGender"] = item->RequiredGender;
            row["ItemRequiredClass"] = item->RequiredClass;
            row["ItemSet"] = item->Set;
            row["ItemRandomStatsId"] = item->RandomStatsId;
            row["ItemRequiredAmount"] = item->RequiredAmount;
            row["ItemImage"] = item->Image;
            row["ItemShape"] = item->Shape;
            row["ItemEffect"] = item->Effect;
            row["ItemStackSize"] = item->StackSize;
            row["ItemSlots"] = item->Slots;
            row["ItemWeight"] = item->Weight;
            row["ItemLightRange"] = static_cast<unsigned char>(item->Light % 15);
            row["ItemLightIntensity"] = static_cast<unsigned char>(item->Light / 15);
            row["ItemDurability"] = item->Durability;
            row["ItemPrice"] = item->Price;

            for (auto stat : *StatEnums)
            {
                if (stat == Stat::Unknown)
                {
                    continue;
                }

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
                row["Stat" + stat.ToString()] = item->Stats[stat];
            }

            for (auto bind : *BindEnums)
            {
                if (bind == BindMode::None)
                {
                    continue;
                }

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
                row["Bind" + bind.ToString()] = item->Bind::HasFlag(bind);
            }

            for (auto special : *SpecialEnums)
            {
                if (special == SpecialItemMode::None)
                {
                    continue;
                }

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
                row["Special" + special.ToString()] = item->Unique::HasFlag(special);
            }

            Table->Rows->Add(row);
        }

        itemInfoGridView->DataSource = Table;
    }

    void ItemInfoFormNew::UpdateFilter()
    {
        auto filterText = txtSearch->Text;
        auto filterType = (static_cast<ListItem*>(drpFilterType->SelectedItem)) == nullptr ? "" : ((((static_cast<ListItem*>(drpFilterType->SelectedItem))->Value) != nullptr) ? (static_cast<ListItem*>(drpFilterType->SelectedItem))->Value : "-1");

        if (filterText.empty() && filterType == "-1")
        {
            (dynamic_cast<DataTable*>(itemInfoGridView->DataSource))->DefaultView->RowFilter = "";
            return;
        }

        std::string rowFilter = StringHelper::formatSimple("([ItemType] = '{0}' OR '{0}' = -1) AND [ItemName] LIKE '%{1}%'", filterType, filterText);

        (dynamic_cast<DataTable*>(itemInfoGridView->DataSource))->DefaultView->RowFilter = rowFilter;
    }

    void ItemInfoFormNew::SaveForm()
    {
        auto lastIndex = getEnvir()->ItemInfoList.Max([&] (std::any x)
        {
            return x::Index;
        });

        for (DataGridViewRow *row : *itemInfoGridView->Rows)
        {
            if ((static_cast<std::string>(row->Cells["ItemName"]->Value)).empty())
            {
                continue;
            }

            ItemInfo *item;

            if ((static_cast<std::string>(row->Cells["ItemIndex"].FormattedValue)).empty())
            {
                ItemInfo tempVar();
                getEnvir()->ItemInfoList.push_back(item = &tempVar);

                item->Index = ++lastIndex;
            }
            else
            {
                int index = static_cast<int>(row->Cells["ItemIndex"]->Value);

                item = getEnvir()->ItemInfoList.FirstOrDefault([&] (std::any x)
                {
                    return x->Index == index;
                });

                if (row->Cells["Modified"]->Value != nullptr && static_cast<bool>(row->Cells["Modified"]->Value) == false)
                {
                    continue;
                }
            }

            item->Name = static_cast<std::string>(row->Cells["ItemName"]->Value);
            item->Type = static_cast<ItemType>(row->Cells["ItemType"]->Value);
            item->Grade = static_cast<ItemGrade>(row->Cells["ItemGrade"]->Value);
            item->RequiredType = static_cast<RequiredType>(row->Cells["ItemRequiredType"]->Value);
            item->RequiredGender = static_cast<RequiredGender>(row->Cells["ItemRequiredGender"]->Value);
            item->RequiredClass = static_cast<RequiredClass>(row->Cells["ItemRequiredClass"]->Value);
            item->Set = static_cast<ItemSet>(row->Cells["ItemSet"]->Value);
            item->RandomStatsId = static_cast<unsigned char>(row->Cells["ItemRandomStatsId"]->Value);
            item->RequiredAmount = static_cast<unsigned char>(row->Cells["ItemRequiredAmount"]->Value);
            item->Image = static_cast<unsigned short>(row->Cells["ItemImage"]->Value);
            item->Shape = static_cast<short>(row->Cells["ItemShape"]->Value);
            item->Effect = static_cast<unsigned char>(row->Cells["ItemEffect"]->Value);
            item->StackSize = static_cast<unsigned short>(row->Cells["ItemStackSize"]->Value);
            item->Slots = static_cast<unsigned char>(row->Cells["ItemSlots"]->Value);
            item->Weight = static_cast<unsigned char>(row->Cells["ItemWeight"]->Value);

            auto light = (static_cast<unsigned char>(row->Cells["ItemLightRange"]->Value) % 15) + (static_cast<unsigned char>(row->Cells["ItemLightIntensity"]->Value) * 15);
            item->Light = static_cast<unsigned char>(std::min(std::numeric_limits<unsigned char>::max(), light));
            item->Durability = static_cast<unsigned short>(row->Cells["ItemDurability"]->Value);
            item->Price = static_cast<unsigned int>(row->Cells["ItemPrice"]->Value);

            item->Stats->Clear();
            item->Bind = BindMode::None;
            item->Unique = SpecialItemMode::None;

            for (DataGridViewColumn *col : *itemInfoGridView->Columns)
            {
                if (col->Name.StartsWith("Stat"))
                {
                    auto stat = col->Name.substr(4);

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
                    Stat enumStat = std::any_cast<Stat>(Enum::Parse(typeof(Stat), stat));

                    item->Stats[enumStat] = static_cast<int>(row->Cells[col->Name]->Value);
                }
                else if (col->Name.StartsWith("Bind"))
                {
                    auto bind = col->Name.substr(4);

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
                    BindMode enumBind = std::any_cast<BindMode>(Enum::Parse(typeof(BindMode), bind));

                    if (static_cast<bool>(row->Cells[col->Name]->Value))
                    {
                        item->Bind |= enumBind;
                    }
                }
                else if (col->Name.StartsWith("Special"))
                {
                    auto special = col->Name.substr(7);

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
                    SpecialItemMode enumSpecial = std::any_cast<SpecialItemMode>(Enum::Parse(typeof(SpecialItemMode), special));

                    if (static_cast<bool>(row->Cells[col->Name]->Value))
                    {
                        item->Unique |= enumSpecial;
                    }
                }
            }
        }
    }

    DataRow *ItemInfoFormNew::FindRowByItemName(const std::string &value)
    {
        for (DataRow *row : *Table->Rows)
        {
            auto val = row["ItemName"];

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            if (val == nullptr ? nullptr : (((val->ToString().Equals(value)) != nullptr) ? val->ToString().Equals(value) : false))
            {
                return row;
            }
        }

        return nullptr;
    }

    void ItemInfoFormNew::itemInfoGridView_CellValidating(std::any sender, DataGridViewCellValidatingEventArgs *e)
    {
        auto col = itemInfoGridView->Columns[e->ColumnIndex];

        auto cell = itemInfoGridView->Rows[e->RowIndex].Cells[col->Name];

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
        if (cell->FormattedValue != nullptr && e->FormattedValue != nullptr && cell->FormattedValue.ToString() == e->FormattedValue.ToString())
        {
            return;
        }

        itemInfoGridView->Rows[e->RowIndex].Cells["Modified"]->Value = true;

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
        auto val = e->FormattedValue.ToString();

        itemInfoGridView->Rows[e->RowIndex]->ErrorText = "";

        //Only AttackSpeed stat can be negative
        int val1;
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        if (col->ValueType == typeof(int) && col->Name != "StatAttackSpeed" && int::TryParse(val, val1) && val1 < 0)
        {
            e->Cancel = true;
            itemInfoGridView->Rows[e->RowIndex]->ErrorText = "the value must be a positive integer";
        }

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        if (col->ValueType == typeof(int) && !int::TryParse(val, _))
        {
            e->Cancel = true;
            itemInfoGridView->Rows[e->RowIndex]->ErrorText = "the value must be an integer";
        }
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        else if (col->ValueType == typeof(unsigned char) && !unsigned char::TryParse(val, _))
        {
            e->Cancel = true;
            itemInfoGridView->Rows[e->RowIndex]->ErrorText = "the value must be a byte";
        }
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        else if (col->ValueType == typeof(short) && !short::TryParse(val, _))
        {
            e->Cancel = true;
            itemInfoGridView->Rows[e->RowIndex]->ErrorText = "the value must be a short";
        }
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        else if (col->ValueType == typeof(unsigned short) && !unsigned short::TryParse(val, _))
        {
            e->Cancel = true;
            itemInfoGridView->Rows[e->RowIndex]->ErrorText = "the value must be a ushort";
        }
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to the C# 'typeof' operator:
        else if (col->ValueType == typeof(long long) && !long long::TryParse(val, _))
        {
            e->Cancel = true;
            itemInfoGridView->Rows[e->RowIndex]->ErrorText = "the value must be a long";
        }
    }

    void ItemInfoFormNew::rbtnViewAll_CheckedChanged(std::any sender, EventArgs *e)
    {
        if (rbtnViewAll->Checked)
        {
            for (DataGridViewColumn *col : *itemInfoGridView->Columns)
            {
                if (col->Name == "Modified")
                {
                    continue;
                }

                col->Visible = true;
                continue;
            }
        }
    }

    void ItemInfoFormNew::rbtnViewBasic_CheckedChanged(std::any sender, EventArgs *e)
    {
        if (rbtnViewBasic->Checked)
        {
            for (DataGridViewColumn *col : *itemInfoGridView->Columns)
            {
                if (col->Name == "ItemIndex" || col->Name == "ItemName" || col->Name == "Modified")
                {
                    continue;
                }

                if (col->Name.StartsWith("Item"))
                {
                    col->Visible = true;
                    continue;
                }

                col->Visible = false;
            }
        }
    }

    void ItemInfoFormNew::rbtnViewStats_CheckedChanged(std::any sender, EventArgs *e)
    {
        if (rbtnViewStats->Checked)
        {
            for (DataGridViewColumn *col : *itemInfoGridView->Columns)
            {
                if (col->Name == "ItemIndex" || col->Name == "ItemName" || col->Name == "Modified")
                {
                    continue;
                }

                if (col->Name.StartsWith("Stat"))
                {
                    col->Visible = true;
                    continue;
                }

                col->Visible = false;
            }
        }
    }

    void ItemInfoFormNew::rbtnViewBinding_CheckedChanged(std::any sender, EventArgs *e)
    {
        if (rbtnViewBinding->Checked)
        {
            for (DataGridViewColumn *col : *itemInfoGridView->Columns)
            {
                if (col->Name == "ItemIndex" || col->Name == "ItemName" || col->Name == "Modified")
                {
                    continue;
                }

                if (col->Name.StartsWith("Bind"))
                {
                    col->Visible = true;
                    continue;
                }

                col->Visible = false;
            }
        }
    }

    void ItemInfoFormNew::rBtnViewSpecial_CheckedChanged(std::any sender, EventArgs *e)
    {
        if (rBtnViewSpecial->Checked)
        {
            for (DataGridViewColumn *col : *itemInfoGridView->Columns)
            {
                if (col->Name == "ItemIndex" || col->Name == "ItemName" || col->Name == "Modified")
                {
                    continue;
                }

                if (col->Name.StartsWith("Special"))
                {
                    col->Visible = true;
                    continue;
                }

                col->Visible = false;
            }
        }
    }

    void ItemInfoFormNew::drpFilterType_SelectedIndexChanged(std::any sender, EventArgs *e)
    {
        UpdateFilter();

        if (drpFilterType->Text == "Gem")
        {
            //TODO - Change columns for gems when gem option is chosen.
        }
        else
        {

        }
    }

    void ItemInfoFormNew::txtSearch_KeyDown(std::any sender, KeyEventArgs *e)
    {
        if (e->KeyCode == Keys->Enter)
        {
            UpdateFilter();

            e->Handled = true;
            e->SuppressKeyPress = true;
        }
    }

    void ItemInfoFormNew::btnImport_Click(std::any sender, EventArgs *e)
    {
        OpenFileDialog *ofd = new OpenFileDialog();
        ofd->Filter = "CSV (*.csv)|*.csv";

        if (ofd->ShowDialog() == System::Windows::Forms::DialogResult::OK)
        {
            auto fileName = ofd->FileName;
            bool fileError = false;

            auto rows = File::ReadAllLines(fileName);

            if (rows.size() > 1)
            {
                auto columns = StringHelper::split(rows[0], ',');

                if (columns.size() < 2)
                {
                    fileError = true;
                    MessageBox::Show("No columns to import.");
                }

                if (!fileError)
                {
                    itemInfoGridView->EditMode = DataGridViewEditMode::EditProgrammatically;

                    int rowsEdited = 0;

                    for (int i = 1; i < rows.size(); i++)
                    {
                        auto row = rows[i];

                        auto cells = StringHelper::split(row, ',');

                        if (StringHelper::isEmptyOrWhiteSpace(cells[0]))
                        {
                            continue;
                        }

                        if (cells.size() != columns.size())
                        {
                            fileError = true;
                            MessageBox::Show(StringHelper::formatSimple("Row {0} column count does not match the headers column count.", i));
                            break;
                        }

                        auto dataRow = FindRowByItemName(cells[0]);

                        itemInfoGridView->BeginEdit(true);

                        if (dataRow == nullptr)
                        {
                            dataRow = Table->NewRow();

                            Table->Rows->Add(dataRow);
                        }

                        try
                        {
                            for (int j = 0; j < columns.size(); j++)
                            {
                                auto column = columns[j];

                                if (StringHelper::isEmptyOrWhiteSpace(column))
                                {
                                    continue;
                                }

                                auto dataColumn = itemInfoGridView->Columns[column];

                                if (dataColumn == nullptr)
                                {
                                    fileError = true;
                                    MessageBox::Show(StringHelper::formatSimple("Column {0} was not found.", column));
                                    break;
                                }

                                if (dataColumn->ValueType->IsEnum)
                                {
                                    dataRow[column] = Enum::Parse(dataColumn->ValueType, cells[j]);
                                }
                                else
                                {
                                    dataRow[column] = cells[j];
                                }
                            }
                        }
                        catch (const std::runtime_error &ex)
                        {
                            fileError = true;
                            MessageBox::Show(StringHelper::formatSimple("Error when importing item {0}. {1}", cells[0], ex.what()));
                            continue;
                        }

                        itemInfoGridView->EndEdit();

                        rowsEdited++;

                        if (fileError)
                        {
                            break;
                        }
                    }

                    if (!fileError)
                    {
                        MessageBox::Show(StringHelper::formatSimple("{0} items have been imported.", rowsEdited));
                    }
                }
            }
            else
            {
                MessageBox::Show("No rows to import.");
            }
        }

        delete ofd;
    }

    void ItemInfoFormNew::btnExport_Click(std::any sender, EventArgs *e)
    {
        if (itemInfoGridView->Rows->Count > 0)
        {
            SaveFileDialog *sfd = new SaveFileDialog();
            sfd->Filter = "CSV (*.csv)|*.csv";
            sfd->FileName = "ItemInfo Output.csv";
            bool fileError = false;
            if (sfd->ShowDialog() == System::Windows::Forms::DialogResult::OK)
            {
                if (FileSystem::fileExists(sfd->FileName))
                {
                    try
                    {
                        File::Delete(sfd->FileName);
                    }
                    catch (const IOException &ex)
                    {
                        fileError = true;
                        MessageBox::Show("It wasn't possible to write the data to the disk." + ex->Message);
                    }
                }
                if (!fileError)
                {
                    try
                    {
                        int columnCount = itemInfoGridView->Columns->Count;
                        std::string columnNames = "";
                        std::vector<std::string> outputCsv(itemInfoGridView->Rows->Count + 1);
                        for (int i = 2; i < columnCount; i++)
                        {
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
                            columnNames += itemInfoGridView->Columns[i]->Name.ToString() + ",";
                        }
                        outputCsv[0] += columnNames;

                        for (int i = 1; (i - 1) < itemInfoGridView->Rows->Count; i++)
                        {
                            for (int j = 2; j < columnCount; j++)
                            {
                                auto cell = itemInfoGridView->Rows[i - 1].Cells[j];

                                auto valueType = itemInfoGridView->Columns[j].ValueType;
                                if (valueType->IsEnum)
                                {
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
                                    outputCsv[i] += ((Enum::ToObject(valueType, (cell->Value != nullptr) ? cell->Value : 0)) == nullptr ? nullptr : ((((Enum::ToObject(valueType, (cell->Value != nullptr) ? cell->Value : 0)).ToString()) != nullptr) ? ((Enum::ToObject(valueType, (cell->Value != nullptr) ? cell->Value : 0)).ToString()) : "")) + ",";
                                }
                                else
                                {
//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
                                    outputCsv[i] += (cell->Value == nullptr ? nullptr : ((cell->Value->ToString() != nullptr) ? cell->Value->ToString() : "")) + ",";
                                }
                            }
                        }

                        File::WriteAllLines(sfd->FileName, outputCsv, Encoding::UTF8);
                        MessageBox::Show("Data Exported Successfully.", "Info");
                    }
                    catch (const std::runtime_error &ex)
                    {
                        MessageBox::Show("Error :" + ex.what());
                    }
                }
            }

            delete sfd;
        }
        else
        {
            MessageBox::Show("No Items To Export.", "Info");
        }
    }

    void ItemInfoFormNew::itemInfoGridView_DefaultValuesNeeded(std::any sender, DataGridViewRowEventArgs *e)
    {
        auto row = e->Row;

        row->Cells["Modified"]->Value = static_cast<bool>(true);
        row->Cells["ItemName"]->Value = "";

        row->Cells["ItemType"]->Value = static_cast<ItemType>(0);
        row->Cells["ItemGrade"]->Value = static_cast<ItemGrade>(0);
        row->Cells["ItemRequiredType"]->Value = static_cast<RequiredType>(0);
        row->Cells["ItemRequiredGender"]->Value = RequiredGender::None;
        row->Cells["ItemRequiredClass"]->Value = RequiredClass::None;
        row->Cells["ItemSet"]->Value = static_cast<ItemSet>(0);
        row->Cells["ItemRandomStatsId"]->Value = static_cast<unsigned char>(0);
        row->Cells["ItemRequiredAmount"]->Value = static_cast<unsigned char>(0);
        row->Cells["ItemImage"]->Value = static_cast<unsigned short>(0);
        row->Cells["ItemShape"]->Value = static_cast<short>(0);
        row->Cells["ItemEffect"]->Value = static_cast<unsigned char>(0);
        row->Cells["ItemStackSize"]->Value = static_cast<unsigned short>(1);
        row->Cells["ItemSlots"]->Value = static_cast<unsigned char>(0);
        row->Cells["ItemWeight"]->Value = static_cast<unsigned char>(0);
        row->Cells["ItemLightRange"]->Value = static_cast<unsigned char>(0);
        row->Cells["ItemLightIntensity"]->Value = static_cast<unsigned char>(0);
        row->Cells["ItemDurability"]->Value = static_cast<unsigned short>(0);
        row->Cells["ItemPrice"]->Value = static_cast<unsigned int>(0);

        for (auto stat : *StatEnums)
        {
            if (stat == Stat::Unknown)
            {
                continue;
            }

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            row->Cells["Stat" + stat.ToString()]->Value = 0;
        }

        for (auto bind : *BindEnums)
        {
            if (bind == BindMode::None)
            {
                continue;
            }

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            row->Cells["Bind" + bind.ToString()]->Value = false;
        }

        for (auto special : *SpecialEnums)
        {
            if (special == SpecialItemMode::None)
            {
                continue;
            }

//C# TO C++ CONVERTER TODO TASK: There is no C++ equivalent to 'ToString':
            row->Cells["Special" + special.ToString()]->Value = false;
        }
    }

    void ItemInfoFormNew::itemInfoGridView_UserDeletingRow(std::any sender, DataGridViewRowCancelEventArgs *e)
    {
        auto row = e->Row;

        if (row->Cells["ItemIndex"]->Value != nullptr)
        {
            int index = static_cast<int>(row->Cells["ItemIndex"]->Value);

            auto item = getEnvir()->ItemInfoList.FirstOrDefault([&] (std::any x)
            {
                return x->Index == index;
            });

            getEnvir()->ItemInfoList.Remove(item);
        }
    }

    void ItemInfoFormNew::ItemInfoFormNew_FormClosed(std::any sender, FormClosedEventArgs *e)
    {
        SaveForm();
        getEnvir()->SaveDB();
    }

    void ItemInfoFormNew::itemInfoGridView_DataError(std::any sender, DataGridViewDataErrorEventArgs *e)
    {

    }

    void ItemInfoFormNew::Dispose(bool disposing)
    {
        if (disposing && (components != nullptr))
        {
            components->Dispose();
        }
        System::Windows::Forms::Form::Dispose(disposing);
    }

    void ItemInfoFormNew::InitializeComponent()
    {
        System::Windows::Forms::DataGridViewCellStyle *dataGridViewCellStyle1 = new System::Windows::Forms::DataGridViewCellStyle();
        System::Windows::Forms::DataGridViewCellStyle *dataGridViewCellStyle2 = new System::Windows::Forms::DataGridViewCellStyle();
        this->itemInfoGridView = new System::Windows::Forms::DataGridView();
        this->Modified = new System::Windows::Forms::DataGridViewCheckBoxColumn();
        this->ItemIndex = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemName = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemType = new System::Windows::Forms::DataGridViewComboBoxColumn();
        this->ItemGrade = new System::Windows::Forms::DataGridViewComboBoxColumn();
        this->ItemRequiredType = new System::Windows::Forms::DataGridViewComboBoxColumn();
        this->ItemRequiredGender = new System::Windows::Forms::DataGridViewComboBoxColumn();
        this->ItemRequiredClass = new System::Windows::Forms::DataGridViewComboBoxColumn();
        this->ItemSet = new System::Windows::Forms::DataGridViewComboBoxColumn();
        this->ItemRandomStatsId = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemRequiredAmount = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemImage = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemShape = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemEffect = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemStackSize = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemSlots = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemWeight = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemLightRange = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemLightIntensity = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemDurability = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->ItemPrice = new System::Windows::Forms::DataGridViewTextBoxColumn();
        this->panel1 = new System::Windows::Forms::Panel();
        this->panel3 = new System::Windows::Forms::Panel();
        this->btnExport = new System::Windows::Forms::Button();
        this->btnImport = new System::Windows::Forms::Button();
        this->lblFilterType = new System::Windows::Forms::Label();
        this->groupView = new System::Windows::Forms::GroupBox();
        this->rBtnViewSpecial = new System::Windows::Forms::RadioButton();
        this->rbtnViewAll = new System::Windows::Forms::RadioButton();
        this->rbtnViewBinding = new System::Windows::Forms::RadioButton();
        this->rbtnViewBasic = new System::Windows::Forms::RadioButton();
        this->rbtnViewStats = new System::Windows::Forms::RadioButton();
        this->drpFilterType = new System::Windows::Forms::ComboBox();
        this->lblSearch = new System::Windows::Forms::Label();
        this->txtSearch = new System::Windows::Forms::TextBox();
        this->panel2 = new System::Windows::Forms::Panel();
        (static_cast<System::ComponentModel::ISupportInitialize*>(this->itemInfoGridView))->BeginInit();
        this->panel1->SuspendLayout();
        this->panel3->SuspendLayout();
        this->groupView->SuspendLayout();
        this->panel2->SuspendLayout();
        this->SuspendLayout();
        // 
        // itemInfoGridView
        // 
        dataGridViewCellStyle1->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleCenter;
        this->itemInfoGridView->AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
        this->itemInfoGridView->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
        this->itemInfoGridView->Columns->AddRange(std::vector<System::Windows::Forms::DataGridViewColumn*> {this->Modified, this->ItemIndex, this->ItemName, this->ItemType, this->ItemGrade, this->ItemRequiredType, this->ItemRequiredGender, this->ItemRequiredClass, this->ItemSet, this->ItemRandomStatsId, this->ItemRequiredAmount, this->ItemImage, this->ItemShape, this->ItemEffect, this->ItemStackSize, this->ItemSlots, this->ItemWeight, this->ItemLightRange, this->ItemLightIntensity, this->ItemDurability, this->ItemPrice});
        dataGridViewCellStyle2->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleCenter;
        dataGridViewCellStyle2->BackColor = System::Drawing::SystemColors::Window;
        dataGridViewCellStyle2->Font = new System::Drawing::Font("Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, (static_cast<unsigned char>(0)));
        dataGridViewCellStyle2->ForeColor = System::Drawing::SystemColors::ControlText;
        dataGridViewCellStyle2->SelectionBackColor = System::Drawing::SystemColors::Highlight;
        dataGridViewCellStyle2->SelectionForeColor = System::Drawing::SystemColors::HighlightText;
        dataGridViewCellStyle2->WrapMode = System::Windows::Forms::DataGridViewTriState::False;
        this->itemInfoGridView->DefaultCellStyle = dataGridViewCellStyle2;
        this->itemInfoGridView->Dock = System::Windows::Forms::DockStyle::Fill;
        this->itemInfoGridView->Location = new System::Drawing::Point(0, 0);
        this->itemInfoGridView->Name = "itemInfoGridView";
        this->itemInfoGridView->RowTemplate.DefaultCellStyle->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleCenter;
        this->itemInfoGridView->Size = new System::Drawing::Size(956, 433);
        this->itemInfoGridView->TabIndex = 0;
        this->itemInfoGridView->CellValidating += new System::Windows::Forms::DataGridViewCellValidatingEventHandler(this->itemInfoGridView_CellValidating);
        this->itemInfoGridView->DataError += new System::Windows::Forms::DataGridViewDataErrorEventHandler(this->itemInfoGridView_DataError);
        this->itemInfoGridView->DefaultValuesNeeded += new System::Windows::Forms::DataGridViewRowEventHandler(this->itemInfoGridView_DefaultValuesNeeded);
        this->itemInfoGridView->UserDeletingRow += new System::Windows::Forms::DataGridViewRowCancelEventHandler(this->itemInfoGridView_UserDeletingRow);
        // 
        // Modified
        // 
        this->Modified->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::ColumnHeader;
        this->Modified->DataPropertyName = "Modified";
        this->Modified->Frozen = true;
        this->Modified->HeaderText = "Modified";
        this->Modified->Name = "Modified";
        this->Modified->ReadOnly = true;
        this->Modified->Width = 53;
        // 
        // ItemIndex
        // 
        this->ItemIndex->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::AllCells;
        this->ItemIndex->DataPropertyName = "ItemIndex";
        this->ItemIndex->Frozen = true;
        this->ItemIndex->HeaderText = "Index";
        this->ItemIndex->Name = "ItemIndex";
        this->ItemIndex->ReadOnly = true;
        this->ItemIndex->Width = 58;
        // 
        // ItemName
        // 
        this->ItemName->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::DisplayedCells;
        this->ItemName->DataPropertyName = "ItemName";
        this->ItemName->Frozen = true;
        this->ItemName->HeaderText = "Name";
        this->ItemName->Name = "ItemName";
        this->ItemName->Width = 60;
        // 
        // ItemType
        // 
        this->ItemType->DataPropertyName = "ItemType";
        this->ItemType->HeaderText = "Type";
        this->ItemType->Name = "ItemType";
        this->ItemType->SortMode = System::Windows::Forms::DataGridViewColumnSortMode::Automatic;
        // 
        // ItemGrade
        // 
        this->ItemGrade->DataPropertyName = "ItemGrade";
        this->ItemGrade->HeaderText = "Grade";
        this->ItemGrade->Name = "ItemGrade";
        // 
        // ItemRequiredType
        // 
        this->ItemRequiredType->DataPropertyName = "ItemRequiredType";
        this->ItemRequiredType->HeaderText = "Required Type";
        this->ItemRequiredType->Name = "ItemRequiredType";
        // 
        // ItemRequiredGender
        // 
        this->ItemRequiredGender->DataPropertyName = "ItemRequiredGender";
        this->ItemRequiredGender->HeaderText = "Required Gender";
        this->ItemRequiredGender->Name = "ItemRequiredGender";
        // 
        // ItemRequiredClass
        // 
        this->ItemRequiredClass->DataPropertyName = "ItemRequiredClass";
        this->ItemRequiredClass->HeaderText = "Required Class";
        this->ItemRequiredClass->Name = "ItemRequiredClass";
        // 
        // ItemSet
        // 
        this->ItemSet->DataPropertyName = "ItemSet";
        this->ItemSet->HeaderText = "Set";
        this->ItemSet->Name = "ItemSet";
        // 
        // ItemRandomStatsId
        // 
        this->ItemRandomStatsId->DataPropertyName = "ItemRandomStatsId";
        this->ItemRandomStatsId->HeaderText = "Random Stats";
        this->ItemRandomStatsId->Name = "ItemRandomStatsId";
        // 
        // ItemRequiredAmount
        // 
        this->ItemRequiredAmount->DataPropertyName = "ItemRequiredAmount";
        this->ItemRequiredAmount->HeaderText = "Required Amount";
        this->ItemRequiredAmount->Name = "ItemRequiredAmount";
        // 
        // ItemImage
        // 
        this->ItemImage->DataPropertyName = "ItemImage";
        this->ItemImage->HeaderText = "Image";
        this->ItemImage->Name = "ItemImage";
        // 
        // ItemShape
        // 
        this->ItemShape->DataPropertyName = "ItemShape";
        this->ItemShape->HeaderText = "Shape";
        this->ItemShape->Name = "ItemShape";
        // 
        // ItemEffect
        // 
        this->ItemEffect->DataPropertyName = "ItemEffect";
        this->ItemEffect->HeaderText = "Effect";
        this->ItemEffect->Name = "ItemEffect";
        // 
        // ItemStackSize
        // 
        this->ItemStackSize->DataPropertyName = "ItemStackSize";
        this->ItemStackSize->HeaderText = "Stack Size";
        this->ItemStackSize->Name = "ItemStackSize";
        // 
        // ItemSlots
        // 
        this->ItemSlots->DataPropertyName = "ItemSlots";
        this->ItemSlots->HeaderText = "Slots";
        this->ItemSlots->Name = "ItemSlots";
        // 
        // ItemWeight
        // 
        this->ItemWeight->DataPropertyName = "ItemWeight";
        this->ItemWeight->HeaderText = "Weight";
        this->ItemWeight->Name = "ItemWeight";
        // 
        // ItemLightRange
        // 
        this->ItemLightRange->DataPropertyName = "ItemLightRange";
        this->ItemLightRange->HeaderText = "Light Range";
        this->ItemLightRange->Name = "ItemLightRange";
        // 
        // ItemLightIntensity
        // 
        this->ItemLightIntensity->DataPropertyName = "ItemLightIntensity";
        this->ItemLightIntensity->HeaderText = "Intensity";
        this->ItemLightIntensity->Name = "ItemLightIntensity";
        // 
        // ItemDurability
        // 
        this->ItemDurability->DataPropertyName = "ItemDurability";
        this->ItemDurability->HeaderText = "Durability";
        this->ItemDurability->Name = "ItemDurability";
        // 
        // ItemPrice
        // 
        this->ItemPrice->DataPropertyName = "ItemPrice";
        this->ItemPrice->HeaderText = "Price";
        this->ItemPrice->Name = "ItemPrice";
        // 
        // panel1
        // 
        this->panel1->Controls->Add(this->panel3);
        this->panel1->Dock = System::Windows::Forms::DockStyle::Top;
        this->panel1->Location = new System::Drawing::Point(0, 0);
        this->panel1->Name = "panel1";
        this->panel1->Size = new System::Drawing::Size(956, 47);
        this->panel1->TabIndex = 1;
        // 
        // panel3
        // 
        this->panel3->Controls->Add(this->btnExport);
        this->panel3->Controls->Add(this->btnImport);
        this->panel3->Controls->Add(this->lblFilterType);
        this->panel3->Controls->Add(this->groupView);
        this->panel3->Controls->Add(this->drpFilterType);
        this->panel3->Controls->Add(this->lblSearch);
        this->panel3->Controls->Add(this->txtSearch);
        this->panel3->Dock = System::Windows::Forms::DockStyle::Fill;
        this->panel3->Location = new System::Drawing::Point(0, 0);
        this->panel3->Name = "panel3";
        this->panel3->Size = new System::Drawing::Size(956, 47);
        this->panel3->TabIndex = 5;
        // 
        // btnExport
        // 
        this->btnExport->Location = new System::Drawing::Point(693, 22);
        this->btnExport->Name = "btnExport";
        this->btnExport->Size = new System::Drawing::Size(75, 23);
        this->btnExport->TabIndex = 6;
        this->btnExport->Text = "Export";
        this->btnExport->UseVisualStyleBackColor = true;
        this->btnExport->Click += new System::EventHandler(this->btnExport_Click);
        // 
        // btnImport
        // 
        this->btnImport->Location = new System::Drawing::Point(611, 22);
        this->btnImport->Name = "btnImport";
        this->btnImport->Size = new System::Drawing::Size(75, 23);
        this->btnImport->TabIndex = 5;
        this->btnImport->Text = "Import";
        this->btnImport->UseVisualStyleBackColor = true;
        this->btnImport->Click += new System::EventHandler(this->btnImport_Click);
        // 
        // lblFilterType
        // 
        this->lblFilterType->AutoSize = true;
        this->lblFilterType->Location = new System::Drawing::Point(334, 9);
        this->lblFilterType->Name = "lblFilterType";
        this->lblFilterType->Size = new System::Drawing::Size(37, 13);
        this->lblFilterType->TabIndex = 3;
        this->lblFilterType->Text = "Type :";
        // 
        // groupView
        // 
        this->groupView->Controls->Add(this->rBtnViewSpecial);
        this->groupView->Controls->Add(this->rbtnViewAll);
        this->groupView->Controls->Add(this->rbtnViewBinding);
        this->groupView->Controls->Add(this->rbtnViewBasic);
        this->groupView->Controls->Add(this->rbtnViewStats);
        this->groupView->Location = new System::Drawing::Point(3, 3);
        this->groupView->Name = "groupView";
        this->groupView->Size = new System::Drawing::Size(325, 41);
        this->groupView->TabIndex = 4;
        this->groupView->TabStop = false;
        this->groupView->Text = "View Mode";
        // 
        // rBtnViewSpecial
        // 
        this->rBtnViewSpecial->AutoSize = true;
        this->rBtnViewSpecial->Location = new System::Drawing::Point(248, 20);
        this->rBtnViewSpecial->Name = "rBtnViewSpecial";
        this->rBtnViewSpecial->Size = new System::Drawing::Size(60, 17);
        this->rBtnViewSpecial->TabIndex = 4;
        this->rBtnViewSpecial->TabStop = true;
        this->rBtnViewSpecial->Text = "Special";
        this->rBtnViewSpecial->UseVisualStyleBackColor = true;
        this->rBtnViewSpecial->CheckedChanged += new System::EventHandler(this->rBtnViewSpecial_CheckedChanged);
        // 
        // rbtnViewAll
        // 
        this->rbtnViewAll->AutoSize = true;
        this->rbtnViewAll->Checked = true;
        this->rbtnViewAll->Location = new System::Drawing::Point(27, 19);
        this->rbtnViewAll->Name = "rbtnViewAll";
        this->rbtnViewAll->Size = new System::Drawing::Size(36, 17);
        this->rbtnViewAll->TabIndex = 0;
        this->rbtnViewAll->TabStop = true;
        this->rbtnViewAll->Text = "All";
        this->rbtnViewAll->UseVisualStyleBackColor = true;
        this->rbtnViewAll->CheckedChanged += new System::EventHandler(this->rbtnViewAll_CheckedChanged);
        // 
        // rbtnViewBinding
        // 
        this->rbtnViewBinding->AutoSize = true;
        this->rbtnViewBinding->Location = new System::Drawing::Point(181, 19);
        this->rbtnViewBinding->Name = "rbtnViewBinding";
        this->rbtnViewBinding->Size = new System::Drawing::Size(60, 17);
        this->rbtnViewBinding->TabIndex = 3;
        this->rbtnViewBinding->TabStop = true;
        this->rbtnViewBinding->Text = "Binding";
        this->rbtnViewBinding->UseVisualStyleBackColor = true;
        this->rbtnViewBinding->CheckedChanged += new System::EventHandler(this->rbtnViewBinding_CheckedChanged);
        // 
        // rbtnViewBasic
        // 
        this->rbtnViewBasic->AutoSize = true;
        this->rbtnViewBasic->Location = new System::Drawing::Point(69, 19);
        this->rbtnViewBasic->Name = "rbtnViewBasic";
        this->rbtnViewBasic->Size = new System::Drawing::Size(51, 17);
        this->rbtnViewBasic->TabIndex = 1;
        this->rbtnViewBasic->TabStop = true;
        this->rbtnViewBasic->Text = "Basic";
        this->rbtnViewBasic->UseVisualStyleBackColor = true;
        this->rbtnViewBasic->CheckedChanged += new System::EventHandler(this->rbtnViewBasic_CheckedChanged);
        // 
        // rbtnViewStats
        // 
        this->rbtnViewStats->AutoSize = true;
        this->rbtnViewStats->Location = new System::Drawing::Point(126, 19);
        this->rbtnViewStats->Name = "rbtnViewStats";
        this->rbtnViewStats->Size = new System::Drawing::Size(49, 17);
        this->rbtnViewStats->TabIndex = 2;
        this->rbtnViewStats->TabStop = true;
        this->rbtnViewStats->Text = "Stats";
        this->rbtnViewStats->UseVisualStyleBackColor = true;
        this->rbtnViewStats->CheckedChanged += new System::EventHandler(this->rbtnViewStats_CheckedChanged);
        // 
        // drpFilterType
        // 
        this->drpFilterType->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
        this->drpFilterType->FormattingEnabled = true;
        this->drpFilterType->Location = new System::Drawing::Point(337, 24);
        this->drpFilterType->Name = "drpFilterType";
        this->drpFilterType->Size = new System::Drawing::Size(121, 21);
        this->drpFilterType->TabIndex = 2;
        this->drpFilterType->SelectedIndexChanged += new System::EventHandler(this->drpFilterType_SelectedIndexChanged);
        // 
        // lblSearch
        // 
        this->lblSearch->AutoSize = true;
        this->lblSearch->Location = new System::Drawing::Point(461, 9);
        this->lblSearch->Name = "lblSearch";
        this->lblSearch->Size = new System::Drawing::Size(44, 13);
        this->lblSearch->TabIndex = 1;
        this->lblSearch->Text = "Search:";
        // 
        // txtSearch
        // 
        this->txtSearch->Location = new System::Drawing::Point(464, 25);
        this->txtSearch->Name = "txtSearch";
        this->txtSearch->Size = new System::Drawing::Size(141, 20);
        this->txtSearch->TabIndex = 0;
        this->txtSearch->KeyDown += new System::Windows::Forms::KeyEventHandler(this->txtSearch_KeyDown);
        // 
        // panel2
        // 
        this->panel2->Controls->Add(this->itemInfoGridView);
        this->panel2->Dock = System::Windows::Forms::DockStyle::Fill;
        this->panel2->Location = new System::Drawing::Point(0, 47);
        this->panel2->Name = "panel2";
        this->panel2->Size = new System::Drawing::Size(956, 433);
        this->panel2->TabIndex = 2;
        // 
        // ItemInfoFormNew
        // 
        this->AutoScaleDimensions = new System::Drawing::SizeF(6.0F, 13.0F);
        this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
        this->ClientSize = new System::Drawing::Size(956, 480);
        this->Controls->Add(this->panel2);
        this->Controls->Add(this->panel1);
        this->Name = "ItemInfoFormNew";
        this->Text = "ItemInfoFormNew";
        this->FormClosed += new System::Windows::Forms::FormClosedEventHandler(this->ItemInfoFormNew_FormClosed);
        (static_cast<System::ComponentModel::ISupportInitialize*>(this->itemInfoGridView))->EndInit();
        this->panel1->ResumeLayout(false);
        this->panel3->ResumeLayout(false);
        this->panel3->PerformLayout();
        this->groupView->ResumeLayout(false);
        this->groupView->PerformLayout();
        this->panel2->ResumeLayout(false);
        this->ResumeLayout(false);

//C# TO C++ CONVERTER TODO TASK: A 'delete dataGridViewCellStyle2' statement was not added since dataGridViewCellStyle2 was assigned to another object. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete dataGridViewCellStyle1' statement was not added since dataGridViewCellStyle1 was assigned to another object. Handle memory management manually.
    }
}
